import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.EventListener;

/**
 * User: James Barker
 * Date: 1/08/11
 */
public class AdminUI extends JPanel{
    JLabel titleLbl = new JLabel("Enter Elevator Parameters: ");
    JLabel noElevatorLbl = new JLabel("No. of elevators: ");
    JTextField noElevatorTxt = new JTextField("1", 3);
    JLabel minFloorLbl = new JLabel("Minimum floor: ");
    JTextField minFloorTxt = new JTextField("1", 3);
    JLabel maxFloorLbl = new JLabel("Maximum floor: ");
    JTextField maxFloorTxt = new JTextField("3", 3);
    JButton startButton = new JButton("start");


    public AdminUI(){
        this.setLayout(new GridLayout(4, 2));
        this.add(titleLbl);
        this.add(startButton);
        this.add(noElevatorLbl);
        this.add(noElevatorTxt);
        this.add(minFloorLbl);
        this.add(minFloorTxt);
        this.add(maxFloorLbl);
        this.add(maxFloorTxt);

    }

    public int getNoElevators() {
        return Integer.parseInt(noElevatorTxt.getText());
    }

    public int getMinFloor() {
        return Integer.parseInt(minFloorTxt.getText());
    }

    public int getMaxFloor() {
        return Integer.parseInt(maxFloorTxt.getText());
    }
}
